
<script>

import emitter from '../../../utils/eventBus';

export default {
    name:"B",
    data(){
        return {
            ttt:0
        }
    },
    created(){
        // 监听(绑定)事件
        emitter.on("chuan",(str)=>{
            console.log("B收到消息了",str);
            this.ttt = str;
        });
    },
    beforeUnmount(){
        emitter.off('chuan')
    }

}

</script>

<template>
    <h1>兄弟B</h1>
</template>

<style lang="css" scoped></style>
